<?php
include('../../__global.php');
include(SERVER_ROOT_PATH.'/include/config/ml_catelog.php');

class aj_del_sys_notice extends ml_controller
{
    private $ntc_id;
    public function initParam()
    {
        $this->ntc_id = (int)$this->input('ntc_id','P');
    }
    public function checkParam()
    {
        $this->check_referer();
        if(!$this->check_permission(ML_PERMISSION_LOGIN_ONLY)) {
            return $this->api_output(ML_RCODE_NOLOGIN);
        }
        else if(!$this->check_permission(ML_PERMISSION_LOGIN_CANWRITE)) {
            return $this->api_output(ML_RCODE_NOACTIVE);
        }
    }
    public function main()
    {
        $oSysNtc = new ml_model_dbSysNoticeRel();
        $oSysNtc->delByUidId($this->__visitor['uid'] , $this->ntc_id);
        
        $this->api_output(ML_RCODE_SUCC);
    }
    
}
new aj_del_sys_notice();